#!/bin/bash

export BASE_DATA_PATH=/mnt/semiterra/mixagol/gene_annotation
export CUR_DIR=${BASE_DATA_PATH}/0_src

mkdir -p ${CUR_DIR}/data_raw
tar -C ${CUR_DIR}/data_raw -xzf ${CUR_DIR}/all.gbk.tar.gz

grep -r "DEFINITION .* complete genome" ${CUR_DIR}/data_raw | cut -d: -f1 | uniq | LC_ALL=C sort > ${CUR_DIR}/complete_genomes.txt

0_src/create_raw_db.py ${CUR_DIR}/raw.db ${CUR_DIR}/complete_genomes.txt

rm -rf data_raw
